import {
  createRouter,
  createWebHashHistory,
  RouteRecordRaw,
} from 'vue-router';
import Home from '../views/home.vue';
import HTTP from '../views/http.vue';

const routes: Array<RouteRecordRaw> = [
  {
    path: '/',
    name: 'Home',
    component: Home,
  },
  {
    path: '/http',
    name: 'hTTP',
    component: HTTP,
  },
  {
    path: '/expose',
    name: 'defineExpose',
    component: () => import('../views/defineExpose/index.vue'), // 懒加载组件
  },
  {
    path: '/props',
    name: 'defineProps',
    component: () => import('../views/defineProps/index.vue'), // 懒加载组件
  },
  {
    path: '/emits',
    name: 'defineEmits',
    component: () => import('../views/defineEmits/index.vue'), // 懒加载组件
  },
];

const router = createRouter({
  history: createWebHashHistory(),
  routes,
});

export default router;
